package com.chaoxuan.uebt.utils;

import android.graphics.Bitmap;
import android.util.Log;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MyWebViewClient extends WebViewClient {
    @Override  //WebView代表是当前的WebView
    public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
        //表示在当前的WebView继续打开网页
        view.loadUrl(request.getUrl().toString());
        return true;
    }

    @Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        super.onPageStarted(view, url, favicon);
        Log.d("WebView","开始访问网页");
    }

    @Override
    public void onPageFinished(WebView view, String url) {
        super.onPageFinished(view, url);
        Log.d("WebView","访问网页结束");
    }
}
